get-function-name-x
Get the name of the function.
module.exports(fn)
⇒ undefined
| string
⏏
This method returns the name of the function, or undefined
if not
a function.
Kind: Exported function
Returns: undefined
| string
- The name of the function, or undefined
if
not a function.
Param | Type | Description |
---|
fn | function | The function to get the name of. |
Example
import getFunctionName from 'get-function-name-x';
console.log(getFunctionName());
console.log(getFunctionName(Number.MIN_VALUE));
console.log(getFunctionName('abc'));
console.log(getFunctionName(true));
console.log(getFunctionName({name: 'abc'}));
console.log(getFunctionName(function() {}));
console.log(getFunctionName(new Function()));
console.log(getFunctionName(function test1() {}));
console.log(getFunctionName(function* test2() {}));
console.log(getFunctionName(class Test {});)